angular.module("myApp")
.controller("HomeControllerChild", ["$scope","$http", function($scope,$http){
	//Ajax请求place
	$http.get("./data/home_place.json").success(function(res){
		$scope.placeTags=res.data.tags;
		$scope.placeEntry=res.data.entry;
	})
	//Ajax请求food
	$http.get("./data/home_food.json").success(function(res){
		$scope.foodTags=res.data.tags;
		$scope.foodEntry=res.data.entry;
	})
	//Ajax请求shop
	$http.get("./data/home_shop.json").success(function(res){
		$scope.shopTags=res.data.tags;
		$scope.shopEntry=res.data.entry;
	})
	//Ajax请求play
	$http.get("./data/home_play.json").success(function(res){
		$scope.playTags=res.data.tags;
		$scope.playEntry=res.data.entry;
	})
	//Ajax请求play
	$http.get("./data/home_list.json").success(function(res){
		$scope.listData=res.data;
		$scope.listLengths=res.data[0].children;
		$scope.changeList= function(e){
			var lis=document.querySelectorAll(".homeChild_AllDirection_li");
			for(var j=0;j<lis.length;j++){
				lis[j].style.backgroundColor="#dfdfdf";
				lis[j].style.color="#000";
			}
			e.target.style.backgroundColor="#fff";
			e.target.style.color="#0FBE79";
			/*右边出现相应的数据*/
	        $scope.listLengths=res.data[this.$index].children;
	       
	    }
	})
	$scope.changeStyle = function(e){
		var aEles = document.querySelectorAll(".aEle");
		for(var k=0;k<aEles.length;k++){
			aEles[k].style.color="#424242"; 
		}
		e.target.style.color="#42d19c"; 
	}
}])